package chapter12;

/**
 * @author lzy
 * @version v1.0
 * Create DateTime: 2019/3/11 14:21
 */
public class WhoCalled {
    public static void main(String[] args) {
        h();
    }

    static void f() {
        try {
            throw new Exception();
        } catch (Exception e) {
            for (StackTraceElement element : e.getStackTrace()) {
                System.out.println(element.getMethodName());
            }
        }
    }

    static void g() {
        f();
    }

    static void h() {
        g();
    }
}
